/**
 * Copyright (C) 2011  E-Robot
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 * @brief MapHIMM.cpp
 *
 * @date 9 déc. 2010
 * @author elca
 * @version 0.1
 */

#include "MapProba.h"
#include "CellProba.h"
#include <QDebug>
#include <QKeyEvent>
#include "../../def.h"
#include "math.h"

MapProba::MapProba(int _nbrCellWidth, int _nbrCellHeight, int _size,int _resolution ):Map(_nbrCellWidth,_nbrCellHeight,_size,_resolution)
{
	//Création des cellules
	int xI,yI;
	for(int i=0;i<nbCellHeight;i++){
		cells.append(QVector<Cell*>());
		for(int j=0;j<nbCellWidth;j++){
			xI= xScene +j*size;
			yI= yScene +i*size;

			cells[i].append(new CellProba(xI,yI,size,size,this));
			connect(this,SIGNAL(changeMask(int)),cells[i].at(j),SLOT(changeMask(int)));
			connect(this,SIGNAL(resetMap()),cells[i].at(j),SLOT(resetCell()));

		}
	}


}

void MapProba::updateCell(QLineF _line){

	update(xScene,yScene,widthScene,heightScene);
}
MapProba::~MapProba()
{

}
